<?php
namespace Home\Model;
use Think\Model;
class BasicGoodsModel extends Model {
	protected $_validate = array(
     array('name','','物品名字已存在！',self::MUST_VALIDATE, 'unique'  ,self::MODEL_INSERT), //添加时 
     array('name','','物品名字已存在！',self::MUST_VALIDATE, 'unique'  ,self::MODEL_UPDATE), //编辑时验证唯一性
   );
	/*//物品所属分类
	 protected $kindsList = array(
           "1"=>"耗材/文印设备",
           "2"=>"IT/数码通讯", 
           "3"=>"办公设备/电器",
           "4"=>"办公日用", 
           "5"=>"食品/饮料", 
           "6"=>"礼品/卡券", 
           "7"=>"文具", 
           "8"=>"纸张"

      );
	   protected $kindsType = array(
          array("id"=>"1","name"=>"耗材/文印设备"),
          array("id"=>"2","name"=>"IT/数码通讯"),
          array("id"=>"3","name"=>"办公设备/电器"),
          array("id"=>"4","name"=>"办公日用"),
          array("id"=>"5","name"=>"食品/饮料"),
          array("id"=>"6","name"=>"礼品/卡券"),
          array("id"=>"7","name"=>"文具"),
          array("id"=>"8","name"=>"纸张")
      );*/
	//物品属性
	 protected $propertyList = array(
           "1"=>"固有类",
           "2"=>"消耗类"
      );
	protected $propertyType = array(
          array("id"=>"1","name"=>"固有类"),
          array("id"=>"2","name"=>"消耗类")
      );

	   /**
    * 返回物品种类的汉字(一维)
    * @return string|array
    */
/*    public function getKindsList($index){
      if (is_int($index)) {
        return $this->kindsList[$index];
      } else {
        return $this->kindsList;
      }
    }*/
	   /**
    * 返回物品种类(二维)
    * @return string|array
    */
 /*   public function getKindsType(){
        return $this->kindsType;
    }*/
    /**
    * 返回物品属性的汉字(一维)
    * @return string|array
    */
    public function getPropertyList($index){
      if (is_int($index)) {
        return $this->propertyList[$index];
      } else {
        return $this->propertyList;
      }
    }
    /**
    * 返回物品种类(二维)
    * @return string|array
    */
    public function getPropertyType(){
        return $this->propertyType;
    }

    

   



 




}